<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>申请小程序</title>
		<script type="text/javascript" src="__JS__/vue.js"></script>
		<!-- 引入样式 -->
		<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
		<!-- 引入组件库 -->
		<script src="https://unpkg.com/element-ui/lib/index.js"></script>
		<link rel="stylesheet" type="text/css" href="__CSS__/style.css">

		<script type="text/javascript" src="__JS__/axios.min.js"></script>

	</head>
	<body>
		<div id="app">
			<div style="width:60%;margin:0 auto;">
				<div>申请小程序</div>
				<el-form ref="form" :model="form" label-width="90px">
					<el-form-item label="小程序名称">
						<el-input v-model="form.name"></el-input>
					</el-form-item>
					<el-form-item label="logo">
						<el-input v-model="form.logo"></el-input>
					</el-form-item>
					<el-form-item>
						<el-button type="primary" @click="onSubmit">立即创建</el-button>
						<el-button>取消</el-button>
					</el-form-item>
				</el-form>
			</div>
		</div>
		<script type="text/javascript">
			new Vue({
				el: '#app',
				data: {
					form:{
						name:'',
						logo:'',
					}
				},
				mounted(){

				},
				methods: {
					onSubmit () {
						axios.post('{$Think.config.url}/platform/createMiniProgram',this.form).then((res)=>{
							if(res.data.success){
						        this.$message({
						        	message: res.data.msg,
						        	type: 'success'
						        });
							}else{
						        this.$message({
						        	message: res.data.msg,
						        	type: 'error'
						        });
							}
						});
					},
				}
			});

		</script>
	</body>
</html>